
import { Column, Entity, PrimaryGeneratedColumn, OneToMany, ManyToOne, JoinColumn } from 'typeorm';
import { CommonEntity } from "./common.entity";
import { StudentTeamEntity } from './studentTeam.entity';
import { TeamTeacherEntity } from './teamTeacher.entity';
import { TeacherVolunteerTeamEntity } from './teacherVolunteerTeam.entity';
import { GroupEntity } from './group.entity';
@Entity('team', {
	comment: '队伍信息表',
	schema: "public"
})
export class TeamEntity extends CommonEntity {
	@PrimaryGeneratedColumn({ type: 'integer', name: 'team_id', comment: '队伍ID' })
	teamId: number;

	@Column({ type: 'integer', name: 'group_id', default: null, comment: '所属分组ID' })
	groupId: number;

	@Column({ type: 'character varying', name: 'team_name', default: null, comment: '毕设名称' })
	teamName: string;

	@Column({ type: 'character varying', name: 'team_link', default: null, comment: '作品链接' })
	teamLink: string;

	@Column({ type: 'character varying', name: 'summary', default: null, comment: '作品简介' })
	summary: string;

	@Column({ type: 'character', name: 'select_flag', default: '0', comment: '状态（0未选择 1已选择）' })
	selectFlag: string;

	@Column({ type: 'character varying', name: 'remark', default: null, comment: '备注' })
	remark: string;

	@Column({ type: 'character', name: 'status', default: '0', comment: '状态（0正常 1停用）' })
	status: string;

	@Column({ type: 'character', name: 'del_flag', default: '0', comment: '删除标志（0代表存在 1代表删除）' })
	delFlag: string;

	@ManyToOne(() => GroupEntity, (groupEntity) => groupEntity.teams)
	@JoinColumn({ name: 'group_id', referencedColumnName: 'groupId' })
	group: GroupEntity;

	@OneToMany(() => StudentTeamEntity, (studentTeamEntity) => studentTeamEntity.team)
	studentTeams: StudentTeamEntity[];

	@OneToMany(() => TeamTeacherEntity, (teamTeacherEntity) => teamTeacherEntity.team)
	teamTeachers: TeamTeacherEntity[];

	@OneToMany(() => TeacherVolunteerTeamEntity, (teacherVolunteer) => teacherVolunteer.team)
	teacherVolunteers: TeacherVolunteerTeamEntity[];
}
